<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>惠品淘管理系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/style/font1.css">
    <link rel="stylesheet" href="/style/weadmin.css">

</head>
<body class="login-bg">

<div class="login">
    <div class="message">惠品淘管理系统登录</div>
    <div id="darkbannerwrap"></div>

    <!--<form method="post" class="layui-form">-->
        <input id="username" name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
        <hr class="hr15">
        <input id="password" name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
        <hr class="hr15">
        <input id="login" class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="button">
        <hr class="hr20" >
    <!--</form>-->
</div>
<script src="/layui/layui.js"></script>
<script src="/layui/jquery.min.js"></script>
<script type="text/javascript">
    layui.config({
        base: '/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');

    var index;

    $(document).ready(function(){
        $("#login").click(function(){
            var username = $("#username").val();
            var password = $("#password").val();
            if(username!="" && password!="")
            {
                index = layer.load(0, {
                    shade: [0.5,'#fff'] //0.1透明度的白色背景
                });

                $.post("/Adminlogin",
                    {
                        username:username,
                        password:password
                    },
                    function(data,status){
                        if (data.code == "000000") {
                            window.location.href="/index"+data.data+".html"
                        }
                        else {
                            layer.alert(data.errorDetail);
                        }
                        layer.close(index); //关闭弹层
                    });
            }
            else
            {
                layer.alert("用户名和密码不能为空!!");
            }
        });
    });
</script>
<!-- 底部结束 -->
</body>
</html>